<?php
namespace app\index\controller;



use think\Controller;
use think\Db;
use think\Loader;

class Index extends Controller
{
    public function index()
    {
        $member=new Students();
        $students=$member->with('Classes')->select();
        //dump($students);
        $this->assign('students', $students);
        return $this->fetch();
    }
    public function test()
    {
//        $member=new StudentsToCourse();
//
//        $st_info = $member->with('Course,Classes')->find(1234);
//    dump($st_info);

        $member=new Students();

        $st_info=$member->with('Classes,Course')->find(1234);

        dump($st_info);

    }
    public function Showinfo($st_id) {
        $member=new Students();

        $st_info = $member->with('Classes,Course')->find($st_id);
        //dump($st_info);

        $this->assign('st_info',$st_info);

//        $member2=new Students();
//        $st_info2=$member2->with('Classes')->find($st_info['cl_id']);
//
//        $this->assign('st_info2',$st_info2);
        return $this->fetch();
    }
}
